using Interface;
using Model.Dto.Teacher;
using Repository;

namespace Service;

/// <summary>
/// 教师服务实现类
/// </summary>
/// <remarks>
/// 提供教师相关的业务逻辑处理，包括登录验证等功能
/// </remarks>
public class TeacherService : ITeacherService
{
    private readonly TeacherRepository _teacherRepository;

    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="teacherRepository">教师仓储</param>
    public TeacherService(TeacherRepository teacherRepository)
    {
        _teacherRepository = teacherRepository;
    }
    
    /// <summary>
    /// 教师登录验证
    /// </summary>
    /// <param name="dto">教师登录数据传输对象</param>
    /// <returns>登录是否成功</returns>
    public async Task<bool> LoginAsync(TeacherLogin dto)
    {
        return await _teacherRepository.LoginAsync(dto);
    }
}